﻿using AutoMapper;
using HamcoWcs.Contract.ContractCommon;
using HamcoWcs.Contract.ContractMes;
using HamcoWcs.DAL;
using HamcoWcs.Entitys.MesMsgQueues;
using HamcoWcs.Models.Common.Enums;
using HamcoWcs.Service.Common;
using System;
using System.Xml;

namespace HamcoWcs.Service.Mes.Parsers
{
    public class MesMsgParser_GetPalletInfoRequest : MesMsgParserBase
    {
        public override void HandleEvent(MesMsgQueue message)
        {
            // todo 给任务赋值物料信息


            var materialInfo = XmlHelper.GetMaterialInfo(message.Return);
            Console.WriteLine(materialInfo?.PalletSettingCode);

            message.Status = (int)EnumMesMsgStatus.Completed;
        }
        public MesMsgParser_GetPalletInfoRequest(ILoggerService loggerService, WcsDbContext wcsDbContext, IMapper mapper) : base(loggerService, wcsDbContext, mapper)
        {
        }

        public override string EventName => "GetPalletInfoRequest";
    }
}
